<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">

<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>DOM Assistant, the modular lightweight JavaScript library</title>
	<style type="text/css">
		@import url("css/domassistant.css");
	</style>
	<!--[if lt IE 7]>
		<link rel="stylesheet" href="css/ie.css" type="text/css">
	<![endif]-->
	<link rel="Shortcut icon" href="http://www.robertnyman.com/favicon.png">
</head>

<body>
	
	<div id="container">
		<div id="inner-container">
			<div id="main-content">
				<h1><a href="index.htm"><span></span>DOMAssistant</a></h1>
				<h2>What is DOMAssistant?</h2>
				<p>The idea of DOMAssistant is to provide a simpler and more consistent way to script against the Document Object Model (DOM) in web browsers. The idea is that everything starts with the element in question, and then performs various methods on it, such as adding/removing classes, finding elements with a certain <code>className</code>, applying events to it, etc.</p>
				
				<p>Example operations look like this:</p>
				
<pre><code>
// Get a direct reference to a DOM element
$("id-of-element");

// Get element's child elements with the class of "mandatory"
$("id-of-element").elmsByClass("mandatory");

/* Get element's child elements with a "type" attribute 
   that has the value "text"
*/
$("id-of-element").elmsByAttribute("type", "text");

// Adds the class "selected" to the element
$("id-of-element").addClass("selected");

// Add a onclick event to the element
$("id-of-element").addEvent("click", functionToCall);

// Chainability interaction with an element
$("id-of-element").elmsByClass("mandatory").addEvent("click", functionToCall);
</code></pre>
				<h2>It's modular</h2>
				<p>DOMAssistant is completely modular, in that sense that it is only dependent on one single core JavaScript file, <code>DOMAssistant.js</code>. All other modules are optional, and you can choose to only use the ones you find necessary in your application. The reasoning behind this is to make the file size usage as small as possible, while at the same time addressing any potential bandwidth issues. The mindset is:</p>
				<blockquote>
					<p>Include only what you use.</p>
				</blockquote>
				
				<h4>Different modules are available for various purposes</h4>
				<dl>
					<dt><a href="modules-domassistant.htm">DOMAssistant</a></dt>
					<dd>The core module for all DOMAssistant functionality. This one is required, but all other modules are entirely optional.</dd>
					<dt><a href="modules-domassistant-ajax.htm">DOMAssistantAJAX</a></dt>
					<dd>Basic functionality for making AJAX requests and returning the result to any function you desire.</dd>
					<dt><a href="modules-domassistant-content.htm">DOMAssistantContent</a></dt>
					<dd>Offers way to create elements, add, remove and replace content in elements.</dd>
					<dt><a href="modules-domassistant-css.htm">DOMAssistantCSS</a></dt>
					<dd>Consists functionality for adding/removing classes from an element, checking if an element has a certain class and to check what rendered style an element has.</dd>
					<dt><a href="modules-domassistant-events.htm">DOMAssistantEvents</a></dt>
					<dd>Offering ways to handle events cross-browser, with the ability of seamlessly adding multiple events to the same element. It also consists of methods to remove added events, preventing default event actions and cancelling the bubbling of events.</dd>
					<dt><a href="modules-domassistant-load.htm">DOMAssistantLoad</a></dt>
					<dd>Gives you a way to call whatever function/-s you want as soon as the DOM has loaded, without the need of waiting for images, flash movies and other external files to load.</dd>
				</dl>
				
				If you feel the need to use all modules, there's <a href="js/DOMAssistantComplete.js">one file with all modules</a> and another <a href="js/DOMAssistantCompressed.js">compressed file with all modules</a>.
				
				<h2>Usage</h2>
				
				<h2>Copyright</h2>
				<p>DOMAssistant is released under a <a href="http://creativecommons.org/licenses/GPL/2.0/">Creative Commons Deed license</a>. Basically, it means that it's free to use and improve, and that the JavaScript files keep their reference to its creator. Like this</p>
				
				<blockquote>
<pre><code>
/*
	DOMAssistant is developed by Robert Nyman, http://www.robertnyman.com, and it is released according to the
	Creative Commons Deed license (http://creativecommons.org/licenses/GPL/2.0/)
	For more information, please see http://www.robertnyman.com/domassistant
*/
</code></pre>
				</blockquote>
											
			</div>
			
			<div id="navigation">
				<div id="navigation-inner">
					<p><em>Current version is 2.0, released September 19th 2007.</em></p>
					<p><em>November 8th 2007 update: <code>elmsByAttribute</code> update. <a href="Release-notes.txt">Release notes</a></em></p>
					<h3>Information</h3>
					<ul>
						<li><a href="index.htm" class="selected">Introduction</a></li>
						<li><a href="compatibility.htm">Compatibility</a></li>
						<li><a href="demo.htm">Demo</a></li>
					</ul>
				
					<h3>Module documentation</h3>
					<ul>
						<li><a href="modules-domassistant.htm">DOMAssistant</a></li>
						<li><a href="modules-domassistant-ajax.htm">DOMAssistantAJAX</a></li>
						<li><a href="modules-domassistant-content.htm">DOMAssistantContent</a></li>
						<li><a href="modules-domassistant-css.htm">DOMAssistantCSS</a></li>
						<li><a href="modules-domassistant-events.htm">DOMAssistantEvents</a></li>						
						<li><a href="modules-domassistant-load.htm">DOMAssistantLoad</a></li>
						<li><a href="documentation/DOMAssistant-documentation.pdf">Complete documentation (PDF)</a></li>
						<li><a href="documentation/DOMAssistant-diagram.pdf">Diagram with all modules and methods (PDF)</a></li>
					</ul>
	
					<h3>Downloads</h3>
					
					<h4>Complete files with all modules</h4>
					<ul>
						<li><a href="http://code.google.com/p/domassistant/downloads/detail?name=DOMAssistantCompressed-2.0.js&amp;can=2&amp;q=#makechanges" title="Download DOMAssistantCompressed.js at Google code">Compressed (10.5 kb)</a></li>
						<li><a href="http://code.google.com/p/domassistant/downloads/detail?name=DOMAssistantComplete-2.0.js&amp;can=2&amp;q=#makechanges" title="Download DOMAssistantComplete.js at Google code">Uncompressed (15.7 kb)</a></li>
					</ul>
					
					<h4>Module by module</h4>
					<ul>
						<li><a href="http://code.google.com/p/domassistant/downloads/detail?name=DOMAssistant-2.0-modules.zip&amp;can=2&amp;q=#makechanges" title="Download DOMAssistant-2.0-modules.zip at Google code">All DOMAssistant modules ZIP file (8.8 kb)</a></li>
						<li><a href="http://code.google.com/p/domassistant/downloads/detail?name=DOMAssistant-2.0.js&amp;can=2&amp;q=" title="Download DOMAssistant.js at Google code">DOMAssistant (4.2 kb)</a></li>
						<li><a href="http://code.google.com/p/domassistant/downloads/detail?name=DOMAssistantAJAX-2.0.js&amp;can=2&amp;q=" title="Download DOMAssistantAJAX.js at Google code">DOMAssistantAJAX (1.4 kb)</a></li>
						<li><a href="http://code.google.com/p/domassistant/downloads/detail?name=DOMAssistantContent-2.0.js&amp;can=2&amp;q=" title="Download DOMAssistantContent.js at Google code">DOMAssistantContent (3.3 kb)</a></li>
						<li><a href="http://code.google.com/p/domassistant/downloads/detail?name=DOMAssistantCSS-2.0.js&amp;can=2&amp;q=" title="Download DOMAssistantCSS.js at Google code">DOMAssistantCSS (2.5 kb)</a></li>
						<li><a href="http://code.google.com/p/domassistant/downloads/detail?name=DOMAssistantEvents-2.0.js&amp;can=2&amp;q=" title="Download DOMAssistantEvents.js at Google code">DOMAssistantEvents (2.2 kb)</a></li>
						<li><a href="http://code.google.com/p/domassistant/downloads/detail?name=DOMAssistantLoad-2.0.js&amp;can=2&amp;q=" title="Download DOMAssistantLoad.js at Google code">DOMAssistantLoad (2.1 kb)</a></li>
					</ul>
								
					<h3>Comments/updates</h3>
					<ul>
						<li><a href="http://www.robertnyman.com/2007/01/25/domass-the-dom-assistant/">First release blog post with comments and information</a></li>
						<li><a href="http://www.robertnyman.com/2007/09/20/releasing-domassistant-20-chainability-ajax-module-domready-xpath-and-more/">Version 2.0 release blog post with comments and information</a></li>
					</ul>
					
					<h3>Sign up for updates</h3>
					<p>Send an e-mail to domassistant [at] robertnyman [dot] com to verify your e-mail address and receive information about updates</p>
				
					<h3>Contact</h3>
					<ul>
						<li><a href="http://www.robertnyman.com/about">Contact the author</a></li>
					</ul>
				</div>	
				
			</div>		
		</div>
		
		<div id="footer">
			Created by Robert Nyman, <a href="http://www.robertnyman.com">http://www.robertnyman.com</a>
		</div>
		
	</div>
	
	<!-- Google Analytics code -->
	<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
	<script type="text/javascript">
		_uacct = "UA-56164-1";
		urchinTracker();
	</script>
	
	<!-- Start of StatCounter Code -->
	<script type="text/javascript">
	<!-- 
	var sc_project=593937; 
	var sc_partition=4; 
	var sc_security="175a1fec"; 
	//-->
	</script>
		
	<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><a class="statcounter" href="http://www.statcounter.com/"><img class="statcounter" src="http://c5.statcounter.com/counter.php?sc_project=593937&amp;java=0&amp;security=175a1fec" alt="free geoip" /></a></div></noscript>
	<!-- End of StatCounter Code -->
	
	<!-- gVisit code -->
	<script type="text/javascript" src="http://www.gvisit.com/record.php?sid=de2c9dfeacdc0124bdb3fe3eab766832"></script>
	
</body>
</html>